<?php
global $_GPC, $_W;
$uniacid = $_W['uniacid'];
$id = $_GPC['id'];
$res = $this->res;
$plus = $this->plus;
load()->func('tpl');
$setting = $this->baseset($uniacid);
$settings = $this->module['config'];
if ($setting['qiandaourl'] != '内置') {
	$setting['qiandaourl'] = $_W['siteroot'] . "app/index.php?i=" . $_W['uniacid'] . "&c=entry&do=qiandao&m=bsht_tbk";
}
if (empty($setting)) {
	message('请先进行参数设置！', referer(), 'error');
}
$ads = pdo_fetchall("SELECT * FROM " . tablename($this->tableads) . " WHERE uniacid = '{$_W['uniacid']} ' AND status=1 order by displayorder desc,id desc");
$allcate = pdo_fetchall("SELECT * FROM " . tablename($this->tablecate) . " WHERE uniacid = '{$_W['uniacid']} ' AND status=1 order by displayorder desc");
$allcatedtk = pdo_fetchall("SELECT * FROM " . tablename($this->tablecatedtk) . " WHERE uniacid = '{$_W['uniacid']} ' AND status=1 order by displayorder desc");
$allcateall = pdo_fetchall("SELECT * FROM " . tablename($this->tablecateall) . " WHERE uniacid = '{$_W['uniacid']} ' AND status=1 order by displayorder desc");
$indexcate = pdo_fetchall("SELECT * FROM " . tablename($this->tablecate) . " WHERE uniacid = '{$_W['uniacid']} ' AND isindex=1 order by displayorder desc  LIMIT 7");
$indexcatedtk = pdo_fetchall("SELECT * FROM " . tablename($this->tablecatedtk) . " WHERE uniacid = '{$_W['uniacid']} ' AND isindex=1 order by displayorder desc  LIMIT 8");
$indexcateall = pdo_fetchall("SELECT * FROM " . tablename($this->tablecateall) . " WHERE uniacid = '{$_W['uniacid']} ' AND isindex=1 order by displayorder desc  LIMIT 8");
if ($setting['istopitems'] != 3) {
	$tops = pdo_fetchall("SELECT * FROM " . tablename($this->tableitemall) . " WHERE uniacid = '{$_W['uniacid']} ' AND istop=1 AND status=1 order by displayorder desc");
	if ($tops) {
		foreach ($tops as $key => $value) {
			$tops[$key]['jiage'] = $tops[$key]['itemfee2'];
			$tops[$key]['jiage2'] = $tops[$key]['itemfee'] - $tops[$key]['itemfee2'];
			$tops[$key]['topurl'] = $this->createMobileUrl('show_all', array('id' => $tops[$key]['id']));
		}
	}
}
$_share['title'] = $setting['fxtit'];
$_share['imgUrl'] = tomedia($setting['fxlogo']);
$_share['desc'] = $setting['fxdes'];
$_share['link'] = $_W['siteroot'] . "app/index.php?i=" . $_W['uniacid'] . "&c=entry&do=index&m=bsht_tbk";
$_W['page']['sitename'] = $setting['sitetitle'];
if (empty($_W['page']['sitename'])) {
	$pagename = '首页';
} else {
	$pagename = $_W['page']['sitename'];
}
include $this->template('index');